

<template>
  <Treeselect
    v-model="value"
    :options="options"
    :normalizer="normalizer"></Treeselect>
</template>
<script>
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import CommonRender from "./commonRender";
export default {
  name:"RenderTreeSelect",
  mixins:[CommonRender],
  components:{
    Treeselect
  },
  data(){
    return {
      value:undefined,
    }
  },
  methods:{
    /** 转换菜单数据结构 */
    normalizer(node) {
      if (node[this.currentItem.optionsChildren] && !node[this.currentItem.optionsChildren].length) {
        delete node[this.currentItem.optionsChildren];
      }
      return {
        id: node[this.currentItem.optionsValue],
        label: node[this.currentItem.optionsLabel],
        children: node[this.currentItem.optionsChildren]
      };
    },
  }
}
</script>
<style scoped lang="scss">

</style>
